import pygame as pg

pg.init()
window = pg.display.set_mode((800, 600))
pg.display.set_caption("keyboard")
window.fill((255, 255, 255))

pg.display.flip()
count = 0
while True:

    for event in pg.event.get():
        pendown = False
        if event.type == pg.QUIT:
            exit()
        elif event.type == pg.MOUSEBUTTONDOWN:
            pendown = True
            print("down")
            mx, my = event.pos
            pg.draw.circle(window, (255, 80, 90), (mx, my), 5)
            pg.display.update()
        elif event.type == pg.MOUSEBUTTONUP:
            pendown = False
            print("up")
            mx, my = event.pos
            pg.draw.circle(window, (255, 255, 255), (mx, my), 5)
            pg.display.update()
        elif event.type == pg.MOUSEMOTION:
            if pendown:
                print("move")
                mx, my = event.pos
                pg.draw.circle(window, (255, 80, 90), (mx, my), 5)
                pg.display.update()
        elif event.type == pg.KEYDOWN:
            print(chr(event.key))
